import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/login'
    },
    {
      path: '/manager',
      name: 'Manager',
      component: () => import('@/views/Manager.vue'),
      redirect: '/manager/home',
      children: [
        { path: 'person', meta: { name: '个人资料' }, component: () => import('@/views/manager/Person.vue')},
        { path: 'password', meta: { name: '修改密码' }, component: () => import('@/views/manager/Password.vue')},
        { path: 'admin', meta: { name: '管理员信息' }, component: () => import('@/views/manager/Admin.vue')},
        { path: 'user', meta: { name: '用户信息' }, component: () => import('@/views/manager/User.vue')},
        // 新路由
        { path: 'friendList', meta: { name: '好友列表' }, component: () => import('@/views/manager/FriendList.vue')},
        { path: 'shareFile', meta: { name: '分享文件信息' }, component: () => import('@/views/manager/ShareFile.vue')},
        { path: 'friendApply', meta: { name: '好友申请' }, component: () => import('@/views/manager/FriendApply.vue')},
        { path: 'transferStation', meta: { name: '文件中转站' }, component: () => import('@/views/manager/TransferStation.vue')},
      ]
    },
    {
      path: '/front',
      name: 'Front',
      component: () => import('@/views/Front.vue'),
      redirect: '/front/home',
      children: [
        { path: 'home', component: () => import('@/views/front/Home.vue')},
        { path: 'person', component: () => import('@/views/front/Person.vue')},
        { path: 'addFriend', component: () => import('@/views/front/AddFriend.vue')},
        { path: 'friendList', component: () => import('@/views/front/FriendList.vue')},
        { path: 'friendApply', component: () => import('@/views/front/FriendApply.vue')},
        { path: 'myFriendApply', component: () => import('@/views/front/MyFriendApply.vue')},
        { path: 'password', component: () => import('@/views/front/Password.vue')},
        { path: 'shareFile', component: () => import('@/views/front/ShareFile.vue')},
        { path: 'transferStation', component: () => import('@/views/front/TransferStation.vue')},
        { path: 'myitbo', component: () => import('@/views/front/Myitbo.vue')},
        { path: 'fileEncryptor', component: () => import('@/views/front/FileEncryptor.vue')},
        { path: 'fileDecryptor', component: () => import('@/views/front/FileDecryptor.vue')},
        { path: 'fileSignatureVerifier', component: () => import('@/views/front/FileSignatureVerifier.vue')},
      ]
    },
    { path: '/login', component: () => import('@/views/Login.vue')},
    { path: '/register', component: () => import('@/views/Register.vue')},
    { path: '/404', component: () => import('@/views/404.vue')},
    { path: '/:pathMatch(.*)', redirect: '/404', hidden: true },
	
  ]
})

export default router
